import java.util.Scanner;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/5/22
 * Time:15:05
 **/
public class Main2 {
    /**
     * 每日一题-猴子分桃
     * Xi--->代表第i个猴子拿的桃子数
     * Xi+4--->代表要分的桃子个数
     * (Xi+4)*(4/5)--->代表分完剩余的桃子数
     *
     * X2+4 = (X1+4) * (4/5)
     * X3+4 = (X2+4) * (4/5) = (X1+4) * (4/5) * (4/5)
     * X4+4 = (X3+4) * (4/5) = (X2+4) * (4/5) * (4/5) = (X1+4) * (4/5)^3
     *
     * 即(Xi+4)*(4/5)^n^--->代表**第n次分完剩余的桃子数**
     * 因为剩余的桃子数为整数，则Xi+4 = 5^n，X1 = 5^n - 4
     *
     * 1~n个猴子分完桃子后给老猴子1个，共n个
     * 剩余(X1+4)* (4/5)^n^个，且需要满足X1最小为1，即为4^n^
     * 再减去最开始借的4个
     * 则老猴子获得的为n + 4^n^ - 4
     *
     * @param args
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            if (n == 0) break;
            long a = (long) (Math.pow(5, n) - 4);
            long b = (long) (Math.pow(4, n) + n - 4);
            System.out.println(a + " " + b);
        }
    }
}
